import Vue from "vue";

import Element from "element-ui";
import "element-ui/lib/theme-chalk/index.css"; // 样式文件

import hljs from "highlight.js";
import "highlight.js/styles/googlecode.css";// 样式文件

// import HeliUI from "heli-ui";
import HeliUI from "heli-ui/dist/heli-ui.common";
import "heli-ui/dist/heli-ui.css"

Vue.directive("highlight", function (el) {
  let blocks = el.querySelector("pre code");

  Array.isArray(blocks) && blocks.forEach(block => {
    hljs.highlightBlock(block);
  })
})

// let lazy = true;
// Vue.mixin({
//   mounted() {
//     if (lazy) {
//       import("heli-ui").then(module => {
//         Vue.use(module.default);
//       });
//       lazy = !lazy;
//     }
//   }
// })

export default ({
  Vue,
  options,
  router,
  siteData
}) => {
  Vue.use(Element);
  Vue.use(HeliUI)
}